package io;

import java.io.File;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 言初
 * Date: 2024-01-12
 * Time: 22:52
 */
public class ioDemo4 {
    //查看目录的下一级有哪些目录和文件
    public static void main(String[] args) {
        File file=new File("test/aaa/bbb");
        //创建目录
        file.mkdirs();

        File file1=new File("test");

        // 查看目录的下一级有哪些目录或文件

        String[] results1=file1.list();
        System.out.println(Arrays.toString(results1)); // [aaa]
        File[] results2=file1.listFiles();
        System.out.println(Arrays.toString(results2)); // [test\aaa]

    }
}
